//
//  RankingTableViewCell.m
//  rrqs
//
//  Created by 朱耀春 on 2019/4/30.
//

#import "RankingTableViewCell.h"

@implementation RankingTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
//1.单量 2.准时率 3.平均时长 4.配送里程
-(void)setMe_data:(NSDictionary *)me_data{
    _name.text = me_data[@"me_name"];
    [_icon sd_setImageWithURL:[NSURL URLWithString:me_data[@"me_image"]] placeholderImage:KHeaderImage];
    _praiseLabel.text = [NSString stringWithFormat:@"%@", me_data[@"me_dianzan"]];
    
    switch (_type) {
        case 1:
        {
            _typeL.text = @"单量";
            _rankingL.text = [NSString stringWithFormat:@"%@", me_data[@"me_danliang"]];
            _num.text = [NSString stringWithFormat:@"%@", me_data[@"me_danliang_all"]];
        }
            break;
        case 2:
        {
            _typeL.text = @"准时率";
            _rankingL.text = [NSString stringWithFormat:@"%@", me_data[@"me_zhunshi"]];
            _num.text = [NSString stringWithFormat:@"%@", me_data[@"me_zhunshi_all"]];
        }
            break;
        case 3:
        {
            _typeL.text = @"平均时长";
            _rankingL.text = [NSString stringWithFormat:@"%@", me_data[@"me_shichang"]];
            _num.text = [NSString stringWithFormat:@"%@", me_data[@"me_shichang_all"]];
        }
            break;
        case 4:
        {
            _typeL.text = @"配送里程";
            _rankingL.text = [NSString stringWithFormat:@"%@", me_data[@"me_licheng"]];
            _num.text = [NSString stringWithFormat:@"%@", me_data[@"me_licheng_all"]];
        }
            break;
            
        default:
            break;
    }
}

-(void)setOther_data:(NSDictionary *)other_data{
    _name.text = other_data[@"other_name"];
    [_icon sd_setImageWithURL:[NSURL URLWithString:other_data[@"other_image"]] placeholderImage:KHeaderImage];
    _praiseLabel.text = [NSString stringWithFormat:@"%@", other_data[@"other_dianzan"]];
    
    switch (_type) {
        case 1:
        {
            _typeL.text = @"单量";
            _num.text = [NSString stringWithFormat:@"%@", other_data[@"other_danliang_all"]];
        }
            break;
        case 2:
        {
            _typeL.text = @"准时率";
            _num.text = [NSString stringWithFormat:@"%@", other_data[@"other_zhunshi_all"]];
        }
            break;
        case 3:
        {
            _typeL.text = @"平均时长";
            _num.text = [NSString stringWithFormat:@"%@", other_data[@"other_shichang_all"]];
        }
            break;
        case 4:
        {
            _typeL.text = @"配送里程";
            _num.text = [NSString stringWithFormat:@"%@", other_data[@"other_licheng_all"]];
        }
            break;
            
        default:
            break;
    }
}



-(void)setModel:(RankingModel *)model{
    _name.text = model.other_name;
    [_icon sd_setImageWithURL:[NSURL URLWithString:model.other_image] placeholderImage:KHeaderImage];
//    _rankingL.text = me_data[@"me_danliang"];
    _num.text = [NSString stringWithFormat:@"%@", model.other_danliang_all];
    _praiseLabel.text = [NSString stringWithFormat:@"%@",model.other_dianzan];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
